/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'regional';
  @endpointMap = {
    cn-hangzhou = 'linkedmall.aliyuncs.com',
    cn-shanghai = 'linkedmall.aliyuncs.com',
    ap-northeast-1 = 'linkedmall.aliyuncs.com',
    ap-northeast-2-pop = 'linkedmall.aliyuncs.com',
    ap-south-1 = 'linkedmall.aliyuncs.com',
    ap-southeast-1 = 'linkedmall.aliyuncs.com',
    ap-southeast-2 = 'linkedmall.aliyuncs.com',
    ap-southeast-3 = 'linkedmall.aliyuncs.com',
    ap-southeast-5 = 'linkedmall.aliyuncs.com',
    cn-beijing = 'linkedmall.aliyuncs.com',
    cn-beijing-finance-1 = 'linkedmall.aliyuncs.com',
    cn-beijing-finance-pop = 'linkedmall.aliyuncs.com',
    cn-beijing-gov-1 = 'linkedmall.aliyuncs.com',
    cn-beijing-nu16-b01 = 'linkedmall.aliyuncs.com',
    cn-chengdu = 'linkedmall.aliyuncs.com',
    cn-edge-1 = 'linkedmall.aliyuncs.com',
    cn-fujian = 'linkedmall.aliyuncs.com',
    cn-haidian-cm12-c01 = 'linkedmall.aliyuncs.com',
    cn-hangzhou-bj-b01 = 'linkedmall.aliyuncs.com',
    cn-hangzhou-finance = 'linkedmall.aliyuncs.com',
    cn-hangzhou-internal-prod-1 = 'linkedmall.aliyuncs.com',
    cn-hangzhou-internal-test-1 = 'linkedmall.aliyuncs.com',
    cn-hangzhou-internal-test-2 = 'linkedmall.aliyuncs.com',
    cn-hangzhou-internal-test-3 = 'linkedmall.aliyuncs.com',
    cn-hangzhou-test-306 = 'linkedmall.aliyuncs.com',
    cn-hongkong = 'linkedmall.aliyuncs.com',
    cn-hongkong-finance-pop = 'linkedmall.aliyuncs.com',
    cn-huhehaote = 'linkedmall.aliyuncs.com',
    cn-north-2-gov-1 = 'linkedmall.aliyuncs.com',
    cn-qingdao = 'linkedmall.aliyuncs.com',
    cn-qingdao-nebula = 'linkedmall.aliyuncs.com',
    cn-shanghai-et15-b01 = 'linkedmall.aliyuncs.com',
    cn-shanghai-et2-b01 = 'linkedmall.aliyuncs.com',
    cn-shanghai-finance-1 = 'linkedmall.aliyuncs.com',
    cn-shanghai-inner = 'linkedmall.aliyuncs.com',
    cn-shanghai-internal-test-1 = 'linkedmall.aliyuncs.com',
    cn-shenzhen = 'linkedmall.aliyuncs.com',
    cn-shenzhen-finance-1 = 'linkedmall.aliyuncs.com',
    cn-shenzhen-inner = 'linkedmall.aliyuncs.com',
    cn-shenzhen-st4-d01 = 'linkedmall.aliyuncs.com',
    cn-shenzhen-su18-b01 = 'linkedmall.aliyuncs.com',
    cn-wuhan = 'linkedmall.aliyuncs.com',
    cn-yushanfang = 'linkedmall.aliyuncs.com',
    cn-zhangbei-na61-b01 = 'linkedmall.aliyuncs.com',
    cn-zhangjiakou = 'linkedmall.aliyuncs.com',
    cn-zhangjiakou-na62-a01 = 'linkedmall.aliyuncs.com',
    cn-zhengzhou-nebula-1 = 'linkedmall.aliyuncs.com',
    eu-central-1 = 'linkedmall.aliyuncs.com',
    eu-west-1 = 'linkedmall.aliyuncs.com',
    eu-west-1-oxs = 'linkedmall.aliyuncs.com',
    me-east-1 = 'linkedmall.aliyuncs.com',
    rus-west-1-pop = 'linkedmall.aliyuncs.com',
    us-east-1 = 'linkedmall.aliyuncs.com',
    us-west-1 = 'linkedmall.aliyuncs.com',
  };

  checkConfig(config);
  @endpoint = getEndpoint('linkedmall', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model ApplyCreateDistributionOrderRequest {
  buyerId?: string(name='BuyerId', example='u***01'),
  deliveryAddress?: string(name='DeliveryAddress'),
  distributionOutTradeId?: string(name='DistributionOutTradeId', example='789***3323'),
  distributionSupplierId?: string(name='DistributionSupplierId'),
  distributorId?: string(name='DistributorId'),
  extInfo?: string(name='ExtInfo'),
  itemInfoLists?: [ 
    {
      distributionMallId?: string(name='DistributionMallId'),
      lmItemId?: string(name='LmItemId'),
      price?: long(name='Price'),
      quantity?: int32(name='Quantity', example='1'),
      skuId?: string(name='SkuId', description='SKU'),
    }
  ](name='ItemInfoLists'),
  tenantId?: string(name='TenantId', example='12***29'),
}

model ApplyCreateDistributionOrderShrinkRequest {
  buyerId?: string(name='BuyerId', example='u***01'),
  deliveryAddress?: string(name='DeliveryAddress'),
  distributionOutTradeId?: string(name='DistributionOutTradeId', example='789***3323'),
  distributionSupplierId?: string(name='DistributionSupplierId'),
  distributorId?: string(name='DistributorId'),
  extInfo?: string(name='ExtInfo'),
  itemInfoListsShrink?: string(name='ItemInfoLists'),
  tenantId?: string(name='TenantId', example='12***29'),
}

model ApplyCreateDistributionOrderResponseBody = {
  code?: string(name='Code', example='0000'),
  logsId?: string(name='LogsId', example='B1756669-4A***F-A6E0E8605FEC'),
  message?: string(name='Message', example='SUCCESS'),
  model?: string(name='Model', example='T213***342'),
  pageNumber?: long(name='PageNumber', example='1'),
  pageSize?: long(name='PageSize', description='pageSize', example='20'),
  requestId?: string(name='RequestId'),
  subCode?: string(name='SubCode'),
  subMessage?: string(name='SubMessage', example='SUCCESS'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='10'),
}

model ApplyCreateDistributionOrderResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ApplyCreateDistributionOrderResponseBody(name='body'),
}

async function applyCreateDistributionOrderWithOptions(tmpReq: ApplyCreateDistributionOrderRequest, runtime: Util.RuntimeOptions): ApplyCreateDistributionOrderResponse {
  Util.validateModel(tmpReq);
  var request = new ApplyCreateDistributionOrderShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.itemInfoLists)) {
    request.itemInfoListsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.itemInfoLists, 'ItemInfoLists', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.buyerId)) {
    body['BuyerId'] = request.buyerId;
  }
  if (!Util.isUnset(request.deliveryAddress)) {
    body['DeliveryAddress'] = request.deliveryAddress;
  }
  if (!Util.isUnset(request.distributionOutTradeId)) {
    body['DistributionOutTradeId'] = request.distributionOutTradeId;
  }
  if (!Util.isUnset(request.distributionSupplierId)) {
    body['DistributionSupplierId'] = request.distributionSupplierId;
  }
  if (!Util.isUnset(request.distributorId)) {
    body['DistributorId'] = request.distributorId;
  }
  if (!Util.isUnset(request.extInfo)) {
    body['ExtInfo'] = request.extInfo;
  }
  if (!Util.isUnset(request.itemInfoListsShrink)) {
    body['ItemInfoLists'] = request.itemInfoListsShrink;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ApplyCreateDistributionOrder',
    version = '2022-05-31',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function applyCreateDistributionOrder(request: ApplyCreateDistributionOrderRequest): ApplyCreateDistributionOrderResponse {
  var runtime = new Util.RuntimeOptions{};
  return applyCreateDistributionOrderWithOptions(request, runtime);
}

model ApplyRefund4DistributionRequest {
  applyReasonTextId?: long(name='ApplyReasonTextId', example='500325'),
  applyRefundCount?: int32(name='ApplyRefundCount', example='1'),
  applyRefundFee?: long(name='ApplyRefundFee', example='790'),
  bizClaimType?: int32(name='BizClaimType', example='1'),
  distributorId?: string(name='DistributorId', example='7662***125'),
  goodsStatus?: int32(name='GoodsStatus', example='1'),
  leaveMessage?: string(name='LeaveMessage'),
  leavePictureLists?: [ 
    {
      desc?: string(name='Desc', example='商品损坏'),
      picture?: string(name='Picture', example='https://www.aliyun.com'),
    }
  ](name='LeavePictureLists'),
  subDistributionOrderId?: string(name='SubDistributionOrderId', example='DIS_343***445'),
  tenantId?: string(name='TenantId', example='213**761'),
}

model ApplyRefund4DistributionShrinkRequest {
  applyReasonTextId?: long(name='ApplyReasonTextId', example='500325'),
  applyRefundCount?: int32(name='ApplyRefundCount', example='1'),
  applyRefundFee?: long(name='ApplyRefundFee', example='790'),
  bizClaimType?: int32(name='BizClaimType', example='1'),
  distributorId?: string(name='DistributorId', example='7662***125'),
  goodsStatus?: int32(name='GoodsStatus', example='1'),
  leaveMessage?: string(name='LeaveMessage'),
  leavePictureListsShrink?: string(name='LeavePictureLists'),
  subDistributionOrderId?: string(name='SubDistributionOrderId', example='DIS_343***445'),
  tenantId?: string(name='TenantId', example='213**761'),
}

model ApplyRefund4DistributionResponseBody = {
  code?: string(name='Code', example='0000'),
  logsId?: string(name='LogsId', example='1'),
  message?: string(name='Message', example='SUCCESS'),
  model?: {
    disputeId?: long(name='DisputeId', example='213***343'),
    disputeStatus?: int32(name='DisputeStatus', example='1'),
    disputeType?: int32(name='DisputeType', example='1'),
    subDistributionOrderId?: string(name='SubDistributionOrderId', example='DIS_343***445'),
  }(name='Model'),
  pageNumber?: long(name='PageNumber', example='1'),
  pageSize?: long(name='PageSize', description='pageSize', example='20'),
  requestId?: string(name='RequestId', example='539E5C68-D8B5-57EC-9D9B-58AFD9E0****'),
  subCode?: string(name='SubCode', example='1004'),
  subMessage?: string(name='SubMessage', example='SUCCESS'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='2'),
}

model ApplyRefund4DistributionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ApplyRefund4DistributionResponseBody(name='body'),
}

async function applyRefund4DistributionWithOptions(tmpReq: ApplyRefund4DistributionRequest, runtime: Util.RuntimeOptions): ApplyRefund4DistributionResponse {
  Util.validateModel(tmpReq);
  var request = new ApplyRefund4DistributionShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.leavePictureLists)) {
    request.leavePictureListsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.leavePictureLists, 'LeavePictureLists', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.applyReasonTextId)) {
    body['ApplyReasonTextId'] = request.applyReasonTextId;
  }
  if (!Util.isUnset(request.applyRefundCount)) {
    body['ApplyRefundCount'] = request.applyRefundCount;
  }
  if (!Util.isUnset(request.applyRefundFee)) {
    body['ApplyRefundFee'] = request.applyRefundFee;
  }
  if (!Util.isUnset(request.bizClaimType)) {
    body['BizClaimType'] = request.bizClaimType;
  }
  if (!Util.isUnset(request.distributorId)) {
    body['DistributorId'] = request.distributorId;
  }
  if (!Util.isUnset(request.goodsStatus)) {
    body['GoodsStatus'] = request.goodsStatus;
  }
  if (!Util.isUnset(request.leaveMessage)) {
    body['LeaveMessage'] = request.leaveMessage;
  }
  if (!Util.isUnset(request.leavePictureListsShrink)) {
    body['LeavePictureLists'] = request.leavePictureListsShrink;
  }
  if (!Util.isUnset(request.subDistributionOrderId)) {
    body['SubDistributionOrderId'] = request.subDistributionOrderId;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ApplyRefund4Distribution',
    version = '2022-05-31',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function applyRefund4Distribution(request: ApplyRefund4DistributionRequest): ApplyRefund4DistributionResponse {
  var runtime = new Util.RuntimeOptions{};
  return applyRefund4DistributionWithOptions(request, runtime);
}

model CancelDistributionTradeRequest {
  distributionTradeId?: string(name='DistributionTradeId', example='15303515*******'),
  distributorId?: string(name='DistributorId', example='1'),
  tenantId?: string(name='TenantId'),
}

model CancelDistributionTradeResponseBody = {
  code?: string(name='Code', example='0000'),
  logsId?: string(name='LogsId', example='1'),
  message?: string(name='Message', example='SUCCESS'),
  pageNumber?: long(name='PageNumber', example='1'),
  pageSize?: long(name='PageSize', description='pageSize', example='20'),
  requestId?: string(name='RequestId', example='5127621C-56B0-5DCA-9745-2936B31D****'),
  subCode?: string(name='SubCode', example='SUCCESS'),
  subMessage?: string(name='SubMessage', example='1004'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='19'),
}

model CancelDistributionTradeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CancelDistributionTradeResponseBody(name='body'),
}

async function cancelDistributionTradeWithOptions(request: CancelDistributionTradeRequest, runtime: Util.RuntimeOptions): CancelDistributionTradeResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.distributionTradeId)) {
    body['DistributionTradeId'] = request.distributionTradeId;
  }
  if (!Util.isUnset(request.distributorId)) {
    body['DistributorId'] = request.distributorId;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CancelDistributionTrade',
    version = '2022-05-31',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function cancelDistributionTrade(request: CancelDistributionTradeRequest): CancelDistributionTradeResponse {
  var runtime = new Util.RuntimeOptions{};
  return cancelDistributionTradeWithOptions(request, runtime);
}

model CancelRefund4DistributionRequest {
  disputeId?: long(name='DisputeId', example='14244******33071'),
  distributorId?: string(name='DistributorId'),
  subDistributionOrderId?: string(name='SubDistributionOrderId'),
  tenantId?: string(name='TenantId'),
}

model CancelRefund4DistributionResponseBody = {
  code?: string(name='Code', example='0000'),
  logsId?: string(name='LogsId', example='1'),
  message?: string(name='Message', example='SUCCESS'),
  model?: {
    disputeId?: long(name='DisputeId'),
    disputeStatus?: int32(name='DisputeStatus', example='1'),
    disputeType?: int32(name='DisputeType', example='1'),
    subDistributionOrderId?: string(name='SubDistributionOrderId'),
  }(name='Model'),
  pageNumber?: long(name='PageNumber', example='1'),
  pageSize?: long(name='PageSize', description='pageSize', example='20'),
  requestId?: string(name='RequestId', example='3B55509D-20AC-5BD5-9A81-D6B7382E****'),
  subCode?: string(name='SubCode', example='1004'),
  subMessage?: string(name='SubMessage', example='1004'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='12'),
}

model CancelRefund4DistributionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CancelRefund4DistributionResponseBody(name='body'),
}

async function cancelRefund4DistributionWithOptions(request: CancelRefund4DistributionRequest, runtime: Util.RuntimeOptions): CancelRefund4DistributionResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.disputeId)) {
    body['DisputeId'] = request.disputeId;
  }
  if (!Util.isUnset(request.distributorId)) {
    body['DistributorId'] = request.distributorId;
  }
  if (!Util.isUnset(request.subDistributionOrderId)) {
    body['SubDistributionOrderId'] = request.subDistributionOrderId;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CancelRefund4Distribution',
    version = '2022-05-31',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function cancelRefund4Distribution(request: CancelRefund4DistributionRequest): CancelRefund4DistributionResponse {
  var runtime = new Util.RuntimeOptions{};
  return cancelRefund4DistributionWithOptions(request, runtime);
}

model ConfirmDisburse4DistributionRequest {
  distributionTradeId?: string(name='DistributionTradeId'),
  distributorId?: string(name='DistributorId'),
  mainDistributionOrderId?: string(name='MainDistributionOrderId'),
  tenantId?: string(name='TenantId'),
}

model ConfirmDisburse4DistributionResponseBody = {
  code?: string(name='Code', example='0000'),
  logsId?: string(name='LogsId'),
  message?: string(name='Message', example='SUCCESS'),
  pageNumber?: long(name='PageNumber', example='1'),
  pageSize?: long(name='PageSize', description='pageSize', example='20'),
  requestId?: string(name='RequestId', example='1718921E-C8D4-55E1-B8D4-114AE537C1B7'),
  subCode?: string(name='SubCode', example='1004'),
  subMessage?: string(name='SubMessage', example='SUCCESS'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='12'),
}

model ConfirmDisburse4DistributionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ConfirmDisburse4DistributionResponseBody(name='body'),
}

async function confirmDisburse4DistributionWithOptions(request: ConfirmDisburse4DistributionRequest, runtime: Util.RuntimeOptions): ConfirmDisburse4DistributionResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.distributionTradeId)) {
    body['DistributionTradeId'] = request.distributionTradeId;
  }
  if (!Util.isUnset(request.distributorId)) {
    body['DistributorId'] = request.distributorId;
  }
  if (!Util.isUnset(request.mainDistributionOrderId)) {
    body['MainDistributionOrderId'] = request.mainDistributionOrderId;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ConfirmDisburse4Distribution',
    version = '2022-05-31',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function confirmDisburse4Distribution(request: ConfirmDisburse4DistributionRequest): ConfirmDisburse4DistributionResponse {
  var runtime = new Util.RuntimeOptions{};
  return confirmDisburse4DistributionWithOptions(request, runtime);
}

model InitApplyRefund4DistributionRequest {
  bizClaimType?: int32(name='BizClaimType', example='1'),
  distributorId?: string(name='DistributorId'),
  goodsStatus?: int32(name='GoodsStatus', example='1'),
  subDistributionOrderId?: string(name='SubDistributionOrderId'),
  tenantId?: string(name='TenantId'),
}

model InitApplyRefund4DistributionResponseBody = {
  code?: string(name='Code', example='0000'),
  logsId?: string(name='LogsId'),
  message?: string(name='Message', example='SUCCESS'),
  model?: {
    bizClaimType?: int32(name='BizClaimType', example='1'),
    mainOrderRefund?: boolean(name='MainOrderRefund', example='false'),
    maxRefundFeeData?: {
      maxRefundFee?: long(name='MaxRefundFee', example='100'),
      minRefundFee?: long(name='MinRefundFee', example='10'),
    }(name='MaxRefundFeeData'),
    refundReasonList?: [ 
      {
        proofRequired?: boolean(name='ProofRequired', example='true'),
        reasonTextId?: string(name='ReasonTextId', example='12323'),
        reasonTips?: string(name='ReasonTips'),
        refundDescRequired?: boolean(name='RefundDescRequired', example='true'),
      }
    ](name='RefundReasonList'),
    subDistributionOrderId?: string(name='SubDistributionOrderId'),
  }(name='Model'),
  pageNumber?: long(name='PageNumber', example='1'),
  pageSize?: long(name='PageSize', description='pageSize', example='20'),
  requestId?: string(name='RequestId', example='A7BE4356-7F92-533E-A31B-2EBF2D67****'),
  subCode?: string(name='SubCode', example='1004'),
  subMessage?: string(name='SubMessage', example='1004'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='5'),
}

model InitApplyRefund4DistributionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: InitApplyRefund4DistributionResponseBody(name='body'),
}

async function initApplyRefund4DistributionWithOptions(request: InitApplyRefund4DistributionRequest, runtime: Util.RuntimeOptions): InitApplyRefund4DistributionResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.bizClaimType)) {
    body['BizClaimType'] = request.bizClaimType;
  }
  if (!Util.isUnset(request.distributorId)) {
    body['DistributorId'] = request.distributorId;
  }
  if (!Util.isUnset(request.goodsStatus)) {
    body['GoodsStatus'] = request.goodsStatus;
  }
  if (!Util.isUnset(request.subDistributionOrderId)) {
    body['SubDistributionOrderId'] = request.subDistributionOrderId;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'InitApplyRefund4Distribution',
    version = '2022-05-31',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function initApplyRefund4Distribution(request: InitApplyRefund4DistributionRequest): InitApplyRefund4DistributionResponse {
  var runtime = new Util.RuntimeOptions{};
  return initApplyRefund4DistributionWithOptions(request, runtime);
}

model InitModifyRefund4DistributionRequest {
  bizClaimType?: int32(name='BizClaimType', example='1'),
  disputeId?: long(name='DisputeId', example='14244******33071'),
  distributorId?: string(name='DistributorId'),
  subDistributionOrderId?: string(name='SubDistributionOrderId'),
  tenantId?: string(name='TenantId'),
}

model InitModifyRefund4DistributionResponseBody = {
  code?: string(name='Code', example='0000'),
  logsId?: string(name='LogsId', example='1'),
  message?: string(name='Message', example='SUCCESS'),
  model?: {
    bizClaimType?: int32(name='BizClaimType', example='1'),
    mainOrderRefund?: boolean(name='MainOrderRefund', example='false'),
    maxRefundFeeData?: {
      maxRefundFee?: long(name='MaxRefundFee', example='10'),
      minRefundFee?: long(name='MinRefundFee', example='100'),
    }(name='MaxRefundFeeData'),
    refundReasonList?: [ 
      {
        proofRequired?: boolean(name='ProofRequired', example='true'),
        reasonTextId?: string(name='ReasonTextId', example='12323'),
        reasonTips?: string(name='ReasonTips'),
        refundDescRequired?: boolean(name='RefundDescRequired', example='true'),
      }
    ](name='RefundReasonList'),
    subDistributionOrderId?: string(name='SubDistributionOrderId'),
  }(name='Model'),
  pageNumber?: long(name='PageNumber', example='1'),
  pageSize?: long(name='PageSize', description='pageSize', example='20'),
  requestId?: string(name='RequestId', example='75F3A591-B1A6-5EFF-8ABF-35AB8804DFA0'),
  subCode?: string(name='SubCode', example='1004'),
  subMessage?: string(name='SubMessage', example='1004'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='1'),
}

model InitModifyRefund4DistributionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: InitModifyRefund4DistributionResponseBody(name='body'),
}

async function initModifyRefund4DistributionWithOptions(request: InitModifyRefund4DistributionRequest, runtime: Util.RuntimeOptions): InitModifyRefund4DistributionResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.bizClaimType)) {
    body['BizClaimType'] = request.bizClaimType;
  }
  if (!Util.isUnset(request.disputeId)) {
    body['DisputeId'] = request.disputeId;
  }
  if (!Util.isUnset(request.distributorId)) {
    body['DistributorId'] = request.distributorId;
  }
  if (!Util.isUnset(request.subDistributionOrderId)) {
    body['SubDistributionOrderId'] = request.subDistributionOrderId;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'InitModifyRefund4Distribution',
    version = '2022-05-31',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function initModifyRefund4Distribution(request: InitModifyRefund4DistributionRequest): InitModifyRefund4DistributionResponse {
  var runtime = new Util.RuntimeOptions{};
  return initModifyRefund4DistributionWithOptions(request, runtime);
}

model ListDistributionItemRequest {
  distributionMallId?: string(name='DistributionMallId'),
  distributorId?: string(name='DistributorId'),
  itemStatus?: int32(name='ItemStatus'),
  lmItemId?: string(name='LmItemId'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='20'),
  tenantId?: string(name='TenantId'),
}

model ListDistributionItemResponseBody = {
  code?: string(name='Code', example='0000'),
  logsId?: string(name='LogsId', example='1'),
  message?: string(name='Message', example='SUCCESS'),
  model?: [ 
    {
      category?: string(name='Category'),
      categoryChain?: [ 
        {
          categoryId?: long(name='CategoryId'),
          leaf?: boolean(name='Leaf'),
          level?: int32(name='Level'),
          name?: string(name='Name'),
          parentId?: long(name='ParentId'),
        }
      ](name='CategoryChain'),
      categoryId?: long(name='CategoryId'),
      descOption?: string(name='DescOption'),
      distributionMallId?: string(name='DistributionMallId'),
      gmtCreate?: string(name='GmtCreate'),
      gmtModified?: string(name='GmtModified'),
      hasQuantity?: boolean(name='HasQuantity'),
      isCanSell?: boolean(name='IsCanSell'),
      itemDesc?: string(name='ItemDesc'),
      itemId?: long(name='ItemId'),
      itemIdStr?: string(name='ItemIdStr'),
      itemImages?: [ string ](name='ItemImages'),
      itemName?: string(name='ItemName'),
      itemTitle?: string(name='ItemTitle'),
      lmAttributeMap?: map[string]string(name='LmAttributeMap'),
      lmAttributeModels?: [ 
        {
          attrId?: long(name='AttrId'),
          category?: int32(name='Category'),
          dataType?: string(name='DataType'),
          description?: string(name='Description'),
          name?: string(name='Name'),
          restriction?: string(name='Restriction'),
          scopeList?: [ string ](name='ScopeList'),
          value?: string(name='Value'),
        }
      ](name='LmAttributeModels'),
      lmItemId?: string(name='LmItemId'),
      mainPicUrl?: string(name='MainPicUrl'),
      picUrl?: string(name='PicUrl'),
      priceCentScope?: string(name='PriceCentScope'),
      propertiesJson?: string(name='PropertiesJson'),
      quantity?: int32(name='Quantity'),
      reservedPrice?: long(name='ReservedPrice'),
      reservedPriceScope?: string(name='ReservedPriceScope'),
      simpleQuantity?: string(name='SimpleQuantity'),
      simpleTotalSoldQuantity?: string(name='SimpleTotalSoldQuantity'),
      skuList?: [ 
        {
          canSell?: boolean(name='CanSell'),
          customizedAttributeMap?: map[string]string(name='CustomizedAttributeMap'),
          extInfo?: string(name='ExtInfo'),
          gmtModified?: string(name='GmtModified'),
          hasQuantity?: boolean(name='HasQuantity'),
          itemId?: long(name='ItemId'),
          lmAttributeModels?: [ 
            {
              attrId?: long(name='AttrId'),
              category?: int32(name='Category'),
              dataType?: string(name='DataType'),
              description?: string(name='Description'),
              name?: string(name='Name'),
              restriction?: string(name='Restriction'),
              scopeList?: [ string ](name='ScopeList'),
              value?: string(name='Value'),
            }
          ](name='LmAttributeModels'),
          lmItemId?: string(name='LmItemId'),
          priceCent?: long(name='PriceCent'),
          quantity?: long(name='Quantity'),
          reservedPrice?: long(name='ReservedPrice'),
          simpleQuantity?: string(name='SimpleQuantity'),
          skuDesc?: string(name='SkuDesc'),
          skuId?: long(name='SkuId'),
          skuPicUrl?: string(name='SkuPicUrl'),
          skuProperties?: map[string]string(name='SkuProperties'),
          skuPropertiesJson?: string(name='SkuPropertiesJson'),
          skuTitle?: string(name='SkuTitle'),
          status?: int32(name='Status'),
          tips?: string(name='Tips'),
          lmSkuAttributeMap?: map[string]string(name='lmSkuAttributeMap'),
        }
      ](name='SkuList'),
      status?: int32(name='Status'),
      tips?: string(name='Tips'),
      totalSoldQuantity?: int32(name='TotalSoldQuantity'),
    }
  ](name='Model'),
  pageNumber?: long(name='PageNumber', example='1'),
  pageSize?: long(name='PageSize', description='pageSize', example='20'),
  requestId?: string(name='RequestId', example='539E5C68-D8B5-57EC-9D9B-58AFD9E0****'),
  subCode?: string(name='SubCode', example='SUCCESS'),
  subMessage?: string(name='SubMessage', example='1004'),
  success?: boolean(name='Success'),
  totalCount?: long(name='TotalCount', example='1'),
}

model ListDistributionItemResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListDistributionItemResponseBody(name='body'),
}

async function listDistributionItemWithOptions(request: ListDistributionItemRequest, runtime: Util.RuntimeOptions): ListDistributionItemResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.distributionMallId)) {
    body['DistributionMallId'] = request.distributionMallId;
  }
  if (!Util.isUnset(request.distributorId)) {
    body['DistributorId'] = request.distributorId;
  }
  if (!Util.isUnset(request.itemStatus)) {
    body['ItemStatus'] = request.itemStatus;
  }
  if (!Util.isUnset(request.lmItemId)) {
    body['LmItemId'] = request.lmItemId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListDistributionItem',
    version = '2022-05-31',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listDistributionItem(request: ListDistributionItemRequest): ListDistributionItemResponse {
  var runtime = new Util.RuntimeOptions{};
  return listDistributionItemWithOptions(request, runtime);
}

model ListDistributionItemWithoutCacheRequest {
  distributionMallId?: string(name='DistributionMallId', example='19e690e*****07a29c8'),
  distributorId?: string(name='DistributorId', example='75547******9212928'),
  itemStatus?: int32(name='ItemStatus', example='1'),
  lmItemId?: string(name='LmItemId', example='10000***-6193664*****'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='20'),
  tenantId?: string(name='TenantId', example='7521****8332932'),
}

model ListDistributionItemWithoutCacheResponseBody = {
  code?: string(name='Code', example='SUCCESS'),
  logsId?: string(name='LogsId', example='1'),
  message?: string(name='Message', example='SUCCESS'),
  model?: [ 
    {
      categoryId?: long(name='CategoryId', example='5001****'),
      categoryIds?: [ long ](name='CategoryIds'),
      city?: string(name='City'),
      current?: string(name='Current', example='2020-01-01 00:00:00'),
      customizedAttributeMap?: map[string]string(name='CustomizedAttributeMap'),
      descOption?: string(name='DescOption', example='<img>pic/edf8d848fa80b1cac055c94652*****.jpg</img>'),
      descPath?: string(name='DescPath', example='pic/edf8d848fa80b1cac055c94652*****.jpg'),
      distributionMallId?: string(name='DistributionMallId', example='19e690e*****07a29c8'),
      features?: map[string]string(name='Features'),
      firstPicUrl?: string(name='FirstPicUrl', example='pic/edf8d848fa80b1cac055c94652*****.jpg'),
      hasQuantity?: boolean(name='HasQuantity', example='true'),
      iforestProps?: [ map[string]string ](name='IforestProps'),
      invoiceType?: int32(name='InvoiceType', example='1'),
      isCanNotBeSoldCode?: string(name='IsCanNotBeSoldCode', example='CAN_NOT_BE_SOLD'),
      isCanNotBeSoldMessage?: string(name='IsCanNotBeSoldMessage'),
      isCanSell?: boolean(name='IsCanSell', example='true'),
      isSellerPayPostfee?: boolean(name='IsSellerPayPostfee', example='true'),
      itemId?: long(name='ItemId', example='65******0310'),
      itemImages?: [ string ](name='ItemImages'),
      itemTitle?: string(name='ItemTitle'),
      itemTotalSimpleValue?: string(name='ItemTotalSimpleValue'),
      itemTotalValue?: int32(name='ItemTotalValue', example='100000'),
      lmItemAttributeMap?: map[string]string(name='LmItemAttributeMap'),
      lmItemCategory?: string(name='LmItemCategory', example='entity'),
      lmItemId?: string(name='LmItemId', example='1000****-630292****'),
      mainPicUrl?: string(name='MainPicUrl', example='pic/edf8d848fa80b1cac055c94652*****.jpg'),
      minPrice?: long(name='MinPrice', example='3900'),
      properties?: map[string][ string ](name='Properties'),
      prov?: string(name='Prov'),
      quantity?: int32(name='Quantity', example='200'),
      reservedPrice?: long(name='ReservedPrice', example='2000'),
      securedTransactions?: int32(name='SecuredTransactions', example='1'),
      simpleQuantity?: string(name='SimpleQuantity'),
      skuModels?: [ 
        {
          customizedAttributeMap?: map[string]string(name='CustomizedAttributeMap'),
          distributionMallId?: string(name='DistributionMallId', example='19e690e*****07a29c8'),
          extJson?: string(name='ExtJson', example='{}'),
          hasQuantity?: boolean(name='HasQuantity', example='true'),
          invoiceType?: int32(name='InvoiceType'),
          isCanNotBeSoldCode?: string(name='IsCanNotBeSoldCode', example='CAN_NOT_BE_SOLD'),
          isCanNotBeSoldMessage?: string(name='IsCanNotBeSoldMessage'),
          itemId?: long(name='ItemId', example='6193664*****'),
          lmItemId?: string(name='LmItemId', example='10000***-6193664*****'),
          lmSkuAttributeMap?: map[string]string(name='LmSkuAttributeMap'),
          priceCent?: long(name='PriceCent', example='7960'),
          quantity?: int32(name='Quantity', example='30000'),
          reservedPrice?: long(name='ReservedPrice', example='8000'),
          simpleQuantity?: string(name='SimpleQuantity'),
          skuId?: long(name='SkuId', example='488****548894'),
          skuPicUrl?: string(name='SkuPicUrl', example='img/12344***.jpg'),
          skuPvs?: string(name='SkuPvs', example='1627207:28320;5919063:6536025;12304035:75366283;122216431:27772'),
          skuTitle?: string(name='SkuTitle'),
          status?: int32(name='Status', example='1'),
          supplierPrice?: long(name='SupplierPrice', example='7960'),
        }
      ](name='SkuModels'),
      skuPropertys?: [ 
        {
          id?: long(name='Id', example='44042249****'),
          text?: string(name='Text'),
          values?: [ 
            {
              id?: long(name='Id', example='600***'),
              text?: string(name='Text'),
            }
          ](name='Values'),
        }
      ](name='SkuPropertys'),
      thirdPartyItemId?: string(name='ThirdPartyItemId', example='44042249****'),
      thirdPartyName?: string(name='ThirdPartyName'),
      userType?: int32(name='UserType'),
      videoPicUrl?: string(name='VideoPicUrl', example='http://video***.oss-cn-shanghai.aliyuncs.com/vms-test/pic/edf8d848fa80b1cac055c94652*****.jpg'),
      videoUrl?: string(name='VideoUrl', example='http://video***.oss-cn-shanghai.aliyuncs.com/vms-test/video/edf8d848fa80b1cac055c94652******.mp4'),
      virtualItemType?: string(name='VirtualItemType', example='cardRoll'),
    }
  ](name='Model'),
  pageNumber?: long(name='PageNumber', example='1'),
  pageSize?: long(name='PageSize', example='20'),
  requestId?: string(name='RequestId', example='5127621C-****-5DCA-9745-2936B31DFD12'),
  subCode?: string(name='SubCode', example='205'),
  subMessage?: string(name='SubMessage', example='SUCCESS'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='27303'),
}

model ListDistributionItemWithoutCacheResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListDistributionItemWithoutCacheResponseBody(name='body'),
}

async function listDistributionItemWithoutCacheWithOptions(request: ListDistributionItemWithoutCacheRequest, runtime: Util.RuntimeOptions): ListDistributionItemWithoutCacheResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.distributionMallId)) {
    body['DistributionMallId'] = request.distributionMallId;
  }
  if (!Util.isUnset(request.distributorId)) {
    body['DistributorId'] = request.distributorId;
  }
  if (!Util.isUnset(request.itemStatus)) {
    body['ItemStatus'] = request.itemStatus;
  }
  if (!Util.isUnset(request.lmItemId)) {
    body['LmItemId'] = request.lmItemId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListDistributionItemWithoutCache',
    version = '2022-05-31',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listDistributionItemWithoutCache(request: ListDistributionItemWithoutCacheRequest): ListDistributionItemWithoutCacheResponse {
  var runtime = new Util.RuntimeOptions{};
  return listDistributionItemWithoutCacheWithOptions(request, runtime);
}

model ListDistributionMallRequest {
  channelSupplierId?: string(name='ChannelSupplierId', example='113428528'),
  distributionMallId?: string(name='DistributionMallId'),
  distributionMallName?: string(name='DistributionMallName'),
  distributorId?: string(name='DistributorId'),
  endDate?: string(name='EndDate', example='2021-10-26 10:29:13'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='20'),
  startDate?: string(name='StartDate', example='2021-10-24 15:29:38'),
  tenantId?: string(name='TenantId'),
}

model ListDistributionMallResponseBody = {
  code?: string(name='Code', example='0000'),
  logsId?: string(name='LogsId', example='1'),
  message?: string(name='Message', example='SUCCESS'),
  model?: [ 
    {
      channelSupplierId?: string(name='ChannelSupplierId'),
      distributionMallId?: string(name='DistributionMallId'),
      distributionMallName?: string(name='DistributionMallName'),
      distributionMallType?: string(name='DistributionMallType'),
      endDate?: string(name='EndDate'),
      startDate?: string(name='StartDate'),
      status?: string(name='Status'),
    }
  ](name='Model'),
  pageNumber?: long(name='PageNumber', example='1'),
  pageSize?: long(name='PageSize', description='pageSize', example='20'),
  requestId?: string(name='RequestId', example='1718921E-C8D4-55E1-B8D4-114AE537C1B7'),
  subCode?: string(name='SubCode', example='SUCCESS'),
  subMessage?: string(name='SubMessage', example='1004'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='1'),
}

model ListDistributionMallResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListDistributionMallResponseBody(name='body'),
}

async function listDistributionMallWithOptions(request: ListDistributionMallRequest, runtime: Util.RuntimeOptions): ListDistributionMallResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.channelSupplierId)) {
    body['ChannelSupplierId'] = request.channelSupplierId;
  }
  if (!Util.isUnset(request.distributionMallId)) {
    body['DistributionMallId'] = request.distributionMallId;
  }
  if (!Util.isUnset(request.distributionMallName)) {
    body['DistributionMallName'] = request.distributionMallName;
  }
  if (!Util.isUnset(request.distributorId)) {
    body['DistributorId'] = request.distributorId;
  }
  if (!Util.isUnset(request.endDate)) {
    body['EndDate'] = request.endDate;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.startDate)) {
    body['StartDate'] = request.startDate;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListDistributionMall',
    version = '2022-05-31',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listDistributionMall(request: ListDistributionMallRequest): ListDistributionMallResponse {
  var runtime = new Util.RuntimeOptions{};
  return listDistributionMallWithOptions(request, runtime);
}

model ModifyRefund4DistributionRequest {
  applyReasonTextId?: long(name='ApplyReasonTextId', example='500325'),
  applyRefundCount?: int32(name='ApplyRefundCount', example='1'),
  applyRefundFee?: long(name='ApplyRefundFee', example='790'),
  bizClaimType?: int32(name='BizClaimType', example='1'),
  disputeId?: long(name='DisputeId', example='14244******33071'),
  distributorId?: string(name='DistributorId', example='1'),
  goodsStatus?: int32(name='GoodsStatus', example='1'),
  leaveMessage?: string(name='LeaveMessage'),
  leavePictureLists?: [ 
    {
      desc?: string(name='Desc', example='https://www.aliyun.com'),
      picture?: string(name='Picture', example='商品损坏'),
    }
  ](name='LeavePictureLists'),
  subDistributionOrderId?: string(name='SubDistributionOrderId', example='1530*********'),
  tenantId?: string(name='TenantId', example='213**112'),
}

model ModifyRefund4DistributionShrinkRequest {
  applyReasonTextId?: long(name='ApplyReasonTextId', example='500325'),
  applyRefundCount?: int32(name='ApplyRefundCount', example='1'),
  applyRefundFee?: long(name='ApplyRefundFee', example='790'),
  bizClaimType?: int32(name='BizClaimType', example='1'),
  disputeId?: long(name='DisputeId', example='14244******33071'),
  distributorId?: string(name='DistributorId', example='1'),
  goodsStatus?: int32(name='GoodsStatus', example='1'),
  leaveMessage?: string(name='LeaveMessage'),
  leavePictureListsShrink?: string(name='LeavePictureLists'),
  subDistributionOrderId?: string(name='SubDistributionOrderId', example='1530*********'),
  tenantId?: string(name='TenantId', example='213**112'),
}

model ModifyRefund4DistributionResponseBody = {
  code?: string(name='Code', example='0000'),
  logsId?: string(name='LogsId', example='1'),
  message?: string(name='Message', example='""'),
  model?: {
    disputeId?: long(name='DisputeId', example='235***343'),
    disputeStatus?: int32(name='DisputeStatus', example='5'),
    disputeType?: int32(name='DisputeType', example='1'),
    subDistributionOrderId?: string(name='SubDistributionOrderId', example='DIS_153***851'),
  }(name='Model'),
  pageNumber?: long(name='PageNumber', example='1'),
  pageSize?: long(name='PageSize', description='pageSize', example='1'),
  requestId?: string(name='RequestId', example='539E5C68-D8B5-57EC-9****8AFD9E0'),
  subCode?: string(name='SubCode', example='200'),
  subMessage?: string(name='SubMessage', example='SUCCESS'),
  success?: boolean(name='Success', example='SUCCESS'),
  totalCount?: long(name='TotalCount', example='1'),
}

model ModifyRefund4DistributionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyRefund4DistributionResponseBody(name='body'),
}

async function modifyRefund4DistributionWithOptions(tmpReq: ModifyRefund4DistributionRequest, runtime: Util.RuntimeOptions): ModifyRefund4DistributionResponse {
  Util.validateModel(tmpReq);
  var request = new ModifyRefund4DistributionShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.leavePictureLists)) {
    request.leavePictureListsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.leavePictureLists, 'LeavePictureLists', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.applyReasonTextId)) {
    body['ApplyReasonTextId'] = request.applyReasonTextId;
  }
  if (!Util.isUnset(request.applyRefundCount)) {
    body['ApplyRefundCount'] = request.applyRefundCount;
  }
  if (!Util.isUnset(request.applyRefundFee)) {
    body['ApplyRefundFee'] = request.applyRefundFee;
  }
  if (!Util.isUnset(request.bizClaimType)) {
    body['BizClaimType'] = request.bizClaimType;
  }
  if (!Util.isUnset(request.disputeId)) {
    body['DisputeId'] = request.disputeId;
  }
  if (!Util.isUnset(request.distributorId)) {
    body['DistributorId'] = request.distributorId;
  }
  if (!Util.isUnset(request.goodsStatus)) {
    body['GoodsStatus'] = request.goodsStatus;
  }
  if (!Util.isUnset(request.leaveMessage)) {
    body['LeaveMessage'] = request.leaveMessage;
  }
  if (!Util.isUnset(request.leavePictureListsShrink)) {
    body['LeavePictureLists'] = request.leavePictureListsShrink;
  }
  if (!Util.isUnset(request.subDistributionOrderId)) {
    body['SubDistributionOrderId'] = request.subDistributionOrderId;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ModifyRefund4Distribution',
    version = '2022-05-31',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifyRefund4Distribution(request: ModifyRefund4DistributionRequest): ModifyRefund4DistributionResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyRefund4DistributionWithOptions(request, runtime);
}

model QueryChildDivisionCodeByIdRequest {
  distributorId?: string(name='DistributorId'),
  divisionCode?: string(name='DivisionCode'),
  tenantId?: string(name='TenantId'),
}

model QueryChildDivisionCodeByIdResponseBody = {
  code?: string(name='Code'),
  logsId?: string(name='LogsId'),
  message?: string(name='Message'),
  model?: {
    divisionList?: [ 
      {
        divisionCode?: long(name='DivisionCode'),
        divisionLevel?: long(name='DivisionLevel'),
        divisionName?: string(name='DivisionName'),
        parentId?: long(name='ParentId'),
        pinyin?: string(name='Pinyin'),
      }
    ](name='DivisionList'),
  }(name='Model'),
  pageNumber?: long(name='PageNumber'),
  pageSize?: long(name='PageSize'),
  requestId?: string(name='RequestId'),
  subCode?: string(name='SubCode'),
  subMessage?: string(name='SubMessage'),
  success?: boolean(name='Success'),
  totalCount?: long(name='TotalCount'),
}

model QueryChildDivisionCodeByIdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryChildDivisionCodeByIdResponseBody(name='body'),
}

async function queryChildDivisionCodeByIdWithOptions(request: QueryChildDivisionCodeByIdRequest, runtime: Util.RuntimeOptions): QueryChildDivisionCodeByIdResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.distributorId)) {
    body['DistributorId'] = request.distributorId;
  }
  if (!Util.isUnset(request.divisionCode)) {
    body['DivisionCode'] = request.divisionCode;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryChildDivisionCodeById',
    version = '2022-05-31',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryChildDivisionCodeById(request: QueryChildDivisionCodeByIdRequest): QueryChildDivisionCodeByIdResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryChildDivisionCodeByIdWithOptions(request, runtime);
}

model QueryDistributionBillDetailRequest {
  billId?: string(name='BillId', example='10000007371****'),
  billPeriod?: string(name='BillPeriod', example='2022-11'),
  billStatus?: string(name='BillStatus'),
  distributionMallId?: string(name='DistributionMallId', example='122889******114694'),
  distributionMallName?: string(name='DistributionMallName'),
  distributorId?: string(name='DistributorId', example='75547******9212928'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='20'),
  tenantId?: string(name='TenantId', example='18******263'),
}

model QueryDistributionBillDetailResponseBody = {
  code?: string(name='Code', example='0000'),
  logsId?: string(name='LogsId', example='1'),
  message?: string(name='Message', example='SUCCESS'),
  model?: {
    data?: [ string ](name='Data'),
    pageNumber?: int32(name='PageNumber', example='1'),
    pageSize?: int32(name='PageSize', example='20'),
    total?: int32(name='Total', example='685'),
  }(name='Model'),
  requestId?: string(name='RequestId', example='A7BE4356-7F92-533E-A31B-2EBF2D67****'),
  subCode?: string(name='SubCode', example='200'),
  subMessage?: string(name='SubMessage', example='SUCCESS'),
  success?: boolean(name='Success', example='true'),
}

model QueryDistributionBillDetailResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryDistributionBillDetailResponseBody(name='body'),
}

async function queryDistributionBillDetailWithOptions(request: QueryDistributionBillDetailRequest, runtime: Util.RuntimeOptions): QueryDistributionBillDetailResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.billId)) {
    body['BillId'] = request.billId;
  }
  if (!Util.isUnset(request.billPeriod)) {
    body['BillPeriod'] = request.billPeriod;
  }
  if (!Util.isUnset(request.billStatus)) {
    body['BillStatus'] = request.billStatus;
  }
  if (!Util.isUnset(request.distributionMallId)) {
    body['DistributionMallId'] = request.distributionMallId;
  }
  if (!Util.isUnset(request.distributionMallName)) {
    body['DistributionMallName'] = request.distributionMallName;
  }
  if (!Util.isUnset(request.distributorId)) {
    body['DistributorId'] = request.distributorId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryDistributionBillDetail',
    version = '2022-05-31',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryDistributionBillDetail(request: QueryDistributionBillDetailRequest): QueryDistributionBillDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryDistributionBillDetailWithOptions(request, runtime);
}

model QueryDistributionMallRequest {
  distributionMallId?: string(name='DistributionMallId'),
  tenantId?: string(name='TenantId'),
}

model QueryDistributionMallResponseBody = {
  bizViewData?: map[string]any(name='BizViewData'),
  code?: string(name='Code', example='0000'),
  logsId?: string(name='LogsId', example='1'),
  message?: string(name='Message', example='SUCCESS'),
  model?: {
    channelSupplierId?: string(name='ChannelSupplierId'),
    distributionMallId?: string(name='DistributionMallId', example='1'),
    distributionMallName?: string(name='DistributionMallName'),
    distributionMallType?: string(name='DistributionMallType', example='SaaS'),
    distributorId?: string(name='DistributorId', example='1'),
    endDate?: string(name='EndDate', example='2022-10-31 23:59:59'),
    startDate?: string(name='StartDate', example='2021-12-10 00:00:00'),
    status?: string(name='Status', example='""'),
  }(name='Model'),
  pageNumber?: long(name='PageNumber', example='1'),
  pageSize?: long(name='PageSize', description='pageSize', example='20'),
  requestId?: string(name='RequestId', example='539E5C68-D8B5-57EC-9D9B-58AFD9E0****'),
  subCode?: string(name='SubCode', example='SUCCESS'),
  subMessage?: string(name='SubMessage', example='1004'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='10'),
}

model QueryDistributionMallResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryDistributionMallResponseBody(name='body'),
}

async function queryDistributionMallWithOptions(request: QueryDistributionMallRequest, runtime: Util.RuntimeOptions): QueryDistributionMallResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.distributionMallId)) {
    body['DistributionMallId'] = request.distributionMallId;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryDistributionMall',
    version = '2022-05-31',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryDistributionMall(request: QueryDistributionMallRequest): QueryDistributionMallResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryDistributionMallWithOptions(request, runtime);
}

model QueryDistributionTradeStatusRequest {
  distributionSupplierId?: string(name='DistributionSupplierId'),
  distributionTradeId?: string(name='DistributionTradeId'),
  distributorId?: string(name='DistributorId'),
  tenantId?: string(name='TenantId'),
}

model QueryDistributionTradeStatusResponseBody = {
  code?: string(name='Code', example='0000'),
  logsId?: string(name='LogsId'),
  message?: string(name='Message', example='SUCCESS'),
  model?: string(name='Model'),
  pageNumber?: long(name='PageNumber', example='1'),
  pageSize?: long(name='PageSize', description='pageSize', example='20'),
  requestId?: string(name='RequestId', example='75F3A591-B1A6-5EFF-8ABF-35AB8804DFA0'),
  subCode?: string(name='SubCode', example='1004'),
  subMessage?: string(name='SubMessage', example='SUCCESS'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='1'),
}

model QueryDistributionTradeStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryDistributionTradeStatusResponseBody(name='body'),
}

async function queryDistributionTradeStatusWithOptions(request: QueryDistributionTradeStatusRequest, runtime: Util.RuntimeOptions): QueryDistributionTradeStatusResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.distributionSupplierId)) {
    body['DistributionSupplierId'] = request.distributionSupplierId;
  }
  if (!Util.isUnset(request.distributionTradeId)) {
    body['DistributionTradeId'] = request.distributionTradeId;
  }
  if (!Util.isUnset(request.distributorId)) {
    body['DistributorId'] = request.distributorId;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryDistributionTradeStatus',
    version = '2022-05-31',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryDistributionTradeStatus(request: QueryDistributionTradeStatusRequest): QueryDistributionTradeStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryDistributionTradeStatusWithOptions(request, runtime);
}

model QueryItemDetailRequest {
  distributionMallId?: string(name='DistributionMallId'),
  distributorId?: string(name='DistributorId'),
  lmItemId?: string(name='LmItemId'),
  tenantId?: string(name='TenantId'),
}

model QueryItemDetailResponseBody = {
  bizViewData?: map[string]any(name='BizViewData'),
  code?: string(name='Code', example='0000'),
  logsId?: string(name='LogsId', example='1'),
  message?: string(name='Message', example='BizItemGroup [LMALL20210830****] has not the item [65728655****].'),
  model?: {
    canNotBeSoldCode?: string(name='CanNotBeSoldCode'),
    canNotBeSoldMessage?: string(name='CanNotBeSoldMessage'),
    categoryId?: long(name='CategoryId', example='50011982'),
    categoryIds?: [ long ](name='CategoryIds'),
    city?: string(name='City'),
    current?: string(name='Current'),
    customizedAttributeMap?: map[string]string(name='CustomizedAttributeMap'),
    descOption?: string(name='DescOption', example='{}'),
    descPath?: string(name='DescPath'),
    distributionMallId?: string(name='DistributionMallId'),
    features?: map[string]string(name='Features'),
    firstPicUrl?: string(name='FirstPicUrl', example='http://yicaivodcache.oss-cn-shanghai.aliyuncs.com/vms-test/vms3/pic/edf8d848fa80b1cac055c94652f*****.jpg'),
    hasQuantity?: boolean(name='HasQuantity'),
    iforestProps?: [ map[string]string ](name='IforestProps'),
    invoiceType?: int32(name='InvoiceType'),
    isCanSell?: boolean(name='IsCanSell'),
    isSellerPayPostfee?: boolean(name='IsSellerPayPostfee'),
    itemId?: long(name='ItemId', example='65******0310'),
    itemImages?: [ string ](name='ItemImages'),
    itemTitle?: string(name='ItemTitle'),
    itemTotalSimpleValue?: string(name='ItemTotalSimpleValue'),
    itemTotalValue?: int32(name='ItemTotalValue'),
    lmItemAttributeMap?: map[string]string(name='LmItemAttributeMap'),
    lmItemCategory?: string(name='LmItemCategory', example='entity'),
    lmItemId?: string(name='LmItemId'),
    mainPicUrl?: string(name='MainPicUrl'),
    minPrice?: long(name='MinPrice'),
    properties?: map[string][ string ](name='Properties'),
    prov?: string(name='Prov'),
    quantity?: int32(name='Quantity'),
    reservedPrice?: long(name='ReservedPrice'),
    simpleQuantity?: string(name='SimpleQuantity'),
    skuModels?: [ 
      {
        canNotBeSoldCode?: string(name='CanNotBeSoldCode'),
        canNotBeSoldMessage?: string(name='CanNotBeSoldMessage'),
        customizedAttributeMap?: map[string]string(name='CustomizedAttributeMap'),
        distributionMallId?: string(name='DistributionMallId'),
        extJson?: string(name='ExtJson'),
        hasQuantity?: boolean(name='HasQuantity'),
        invoiceType?: int32(name='InvoiceType'),
        itemId?: long(name='ItemId'),
        lmItemId?: string(name='LmItemId'),
        lmSkuAttributeMap?: map[string]string(name='LmSkuAttributeMap'),
        priceCent?: long(name='PriceCent'),
        quantity?: int32(name='Quantity'),
        reservedPrice?: long(name='ReservedPrice'),
        simpleQuantity?: string(name='SimpleQuantity'),
        skuId?: long(name='SkuId'),
        skuPicUrl?: string(name='SkuPicUrl'),
        skuPvs?: string(name='SkuPvs'),
        skuTitle?: string(name='SkuTitle'),
        status?: int32(name='Status'),
      }
    ](name='SkuModels', description='sku list'),
    skuPropertys?: [ 
      {
        id?: long(name='Id'),
        text?: string(name='Text'),
        values?: [ 
          {
            id?: long(name='Id'),
            text?: string(name='Text'),
          }
        ](name='Values'),
      }
    ](name='SkuPropertys'),
    thirdPartyItemId?: string(name='ThirdPartyItemId'),
    thirdPartyName?: string(name='ThirdPartyName'),
    videoPicUrl?: string(name='VideoPicUrl', example='http://yicaivodcache.oss-cn-shanghai.aliyuncs.com/vms-test/vms3/pic/edf8d848fa80b1cac055c94652*****.jpg'),
    videoUrl?: string(name='VideoUrl', example='http://yicaivodcache.oss-cn-shanghai.aliyuncs.com/vms-test/vms3/video/edf8d848fa80b1cac055c94652******.mp4'),
    virtualItemType?: string(name='VirtualItemType'),
  }(name='Model'),
  pageNumber?: long(name='PageNumber', example='1'),
  pageSize?: long(name='PageSize', description='pageSize', example='20'),
  requestId?: string(name='RequestId', example='E46C790E-B1F2-51EF-B6F8-B52404B5****'),
  subCode?: string(name='SubCode', example='SUCCESS'),
  subMessage?: string(name='SubMessage', example='1004'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='5'),
}

model QueryItemDetailResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryItemDetailResponseBody(name='body'),
}

async function queryItemDetailWithOptions(request: QueryItemDetailRequest, runtime: Util.RuntimeOptions): QueryItemDetailResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.distributionMallId)) {
    body['DistributionMallId'] = request.distributionMallId;
  }
  if (!Util.isUnset(request.distributorId)) {
    body['DistributorId'] = request.distributorId;
  }
  if (!Util.isUnset(request.lmItemId)) {
    body['LmItemId'] = request.lmItemId;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryItemDetail',
    version = '2022-05-31',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryItemDetail(request: QueryItemDetailRequest): QueryItemDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryItemDetailWithOptions(request, runtime);
}

model QueryItemDetailWithDivisionRequest {
  distributionMallId?: string(name='DistributionMallId', example='1339d4e******46ea9d126df506af8d2b'),
  distributorId?: string(name='DistributorId', example='75547******9212928'),
  divisionCode?: string(name='DivisionCode', example='410503006'),
  lmItemId?: string(name='LmItemId', example='10000035-61936646****'),
  tenantId?: string(name='TenantId', example='18******263'),
}

model QueryItemDetailWithDivisionResponseBody = {
  code?: string(name='Code', example='SUCCESS'),
  logsId?: string(name='LogsId', example='1'),
  message?: string(name='Message', example='Success'),
  model?: {
    canNotBeSoldCode?: string(name='CanNotBeSoldCode', example='NULL'),
    canNotBeSoldMassage?: string(name='CanNotBeSoldMassage', example='NULL'),
    canSell?: boolean(name='CanSell', example='true'),
    categoryId?: long(name='CategoryId', example='50011****'),
    categoryIds?: [ long ](name='CategoryIds'),
    city?: string(name='City'),
    current?: string(name='Current', example='2020-01-01 00:00:00'),
    customizedAttributeMap?: map[string]string(name='CustomizedAttributeMap'),
    descOption?: string(name='DescOption', example='<img>pic/edf8d848fa80b1cac055c94652*****.jpg</img>'),
    descPath?: string(name='DescPath', example='pic/edf8d848fa80b1cac055c94652*****.jpg'),
    distributionMallId?: string(name='DistributionMallId', example='122889******114694'),
    features?: map[string]string(name='Features'),
    firstPicUrl?: string(name='FirstPicUrl', example='pic/edf8d848fa80b1cac055c94652*****.jpg'),
    hasQuantity?: boolean(name='HasQuantity'),
    iforestProps?: [ map[string]string ](name='IforestProps'),
    invoiceType?: int32(name='InvoiceType', example='1'),
    itemId?: long(name='ItemId', example='65******0310'),
    itemImages?: [ string ](name='ItemImages'),
    itemTitle?: string(name='ItemTitle'),
    itemTotalSimpleValue?: string(name='ItemTotalSimpleValue'),
    itemTotalValue?: int32(name='ItemTotalValue', example='-1'),
    lmItemAttributeMap?: map[string]string(name='LmItemAttributeMap'),
    lmItemCategory?: string(name='LmItemCategory', example='entity'),
    lmItemId?: string(name='LmItemId', example='10000**-630292***'),
    mainPicUrl?: string(name='MainPicUrl', example='pic/edf8d848fa80b1cac055c94652*****.jpg'),
    minPrice?: long(name='MinPrice', example='3900'),
    properties?: map[string][ string ](name='Properties'),
    prov?: string(name='Prov'),
    quantity?: int32(name='Quantity', example='-1'),
    reservePrice?: long(name='ReservePrice', example='3900'),
    securedTransactions?: int32(name='SecuredTransactions', example='1'),
    sellerPayPostfee?: boolean(name='SellerPayPostfee', example='true'),
    simpleQuantity?: string(name='SimpleQuantity'),
    skuModels?: [ 
      {
        canNotBeSoldCode?: string(name='CanNotBeSoldCode', example='NULL'),
        canNotBeSoldMassage?: string(name='CanNotBeSoldMassage', example='NULL'),
        customizedAttributeMap?: map[string]string(name='CustomizedAttributeMap'),
        distributionMallId?: string(name='DistributionMallId', example='401e6c8****39b05797ac841907ca'),
        extJson?: string(name='ExtJson', example='{\\"outShopId\\":\\"3163****7\\"}'),
        hasQuantity?: boolean(name='HasQuantity', example='true'),
        invoiceType?: int32(name='InvoiceType'),
        itemId?: long(name='ItemId', example='56090358****'),
        lmItemId?: string(name='LmItemId', example='10026053-67222490****'),
        lmSkuAttributeMap?: map[string]string(name='LmSkuAttributeMap'),
        priceCent?: long(name='PriceCent', example='3990'),
        quantity?: int32(name='Quantity', example='-1'),
        reservePrice?: long(name='ReservePrice', example='788'),
        simpleQuantity?: string(name='SimpleQuantity'),
        skuId?: long(name='SkuId', example='-1'),
        skuPicUrl?: string(name='SkuPicUrl', example='img/12344***.jpg'),
        skuPvs?: string(name='SkuPvs', example='1627207:28320;5919063:6536025;12304035:75366283;122216431:27772'),
        skuTitle?: string(name='SkuTitle'),
        status?: int32(name='Status', example='1'),
        supplierPrice?: long(name='SupplierPrice', example='9900'),
      }
    ](name='SkuModels', description='sku list'),
    skuPropertys?: [ 
      {
        id?: long(name='Id', example='44042249****'),
        text?: string(name='Text', example='162720***'),
        values?: [ 
          {
            id?: long(name='Id', example='44042249****'),
            text?: string(name='Text'),
          }
        ](name='Values'),
      }
    ](name='SkuPropertys'),
    thirdPartyItemId?: string(name='ThirdPartyItemId', example='44042249****'),
    thirdPartyName?: string(name='ThirdPartyName'),
    userType?: int32(name='UserType', example='1'),
    videoPicUrl?: string(name='VideoPicUrl', example='pic/edf8d848fa80b1cac055c94652*****.jpg'),
    videoUrl?: string(name='VideoUrl', example='video/edf8d848fa80b1cac055c94652******.mp4'),
    virtualItemType?: string(name='VirtualItemType', example='cardRoll'),
  }(name='Model'),
  pageNumber?: long(name='PageNumber', example='1'),
  pageSize?: long(name='PageSize', description='pageSize', example='20'),
  requestId?: string(name='RequestId', example='BA157565-3358-5D80-9330-************'),
  subCode?: string(name='SubCode', example='201'),
  subMessage?: string(name='SubMessage', example='SUCCESS'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='19'),
}

model QueryItemDetailWithDivisionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryItemDetailWithDivisionResponseBody(name='body'),
}

async function queryItemDetailWithDivisionWithOptions(request: QueryItemDetailWithDivisionRequest, runtime: Util.RuntimeOptions): QueryItemDetailWithDivisionResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.distributionMallId)) {
    body['DistributionMallId'] = request.distributionMallId;
  }
  if (!Util.isUnset(request.distributorId)) {
    body['DistributorId'] = request.distributorId;
  }
  if (!Util.isUnset(request.divisionCode)) {
    body['DivisionCode'] = request.divisionCode;
  }
  if (!Util.isUnset(request.lmItemId)) {
    body['LmItemId'] = request.lmItemId;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryItemDetailWithDivision',
    version = '2022-05-31',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryItemDetailWithDivision(request: QueryItemDetailWithDivisionRequest): QueryItemDetailWithDivisionResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryItemDetailWithDivisionWithOptions(request, runtime);
}

model QueryItemGuideRetailPriceRequest {
  distributionMallId?: string(name='DistributionMallId', example='122889******114694'),
  distributorId?: string(name='DistributorId', example='75547******9212928'),
  lmItemIds?: [ string ](name='LmItemIds'),
  tenantId?: string(name='TenantId', example='18******263'),
}

model QueryItemGuideRetailPriceShrinkRequest {
  distributionMallId?: string(name='DistributionMallId', example='122889******114694'),
  distributorId?: string(name='DistributorId', example='75547******9212928'),
  lmItemIdsShrink?: string(name='LmItemIds'),
  tenantId?: string(name='TenantId', example='18******263'),
}

model QueryItemGuideRetailPriceResponseBody = {
  code?: string(name='Code', example='0000'),
  logsId?: string(name='LogsId', example='1'),
  message?: string(name='Message', example='SUCCESS'),
  model?: [ 
    {
      distributionMallId?: string(name='DistributionMallId', example='19e690e*****07a29c8'),
      guideRetailPriceScope?: string(name='GuideRetailPriceScope', example='1000~2000'),
      itemId?: long(name='ItemId', example='65******0310'),
      itemTitle?: string(name='ItemTitle'),
      lmItemId?: string(name='LmItemId', example='1000****-630292****'),
      lowGuideRetailPriceScope?: string(name='LowGuideRetailPriceScope'),
      reservedPrice?: long(name='ReservedPrice', example='2000'),
      reservedPriceScope?: string(name='ReservedPriceScope', example='1000~2000'),
      skuModels?: [ 
        {
          distributionMallId?: string(name='DistributionMallId', example='39cc1****5c7211005187c'),
          guideRetailPrice?: long(name='GuideRetailPrice', example='7960'),
          itemId?: long(name='ItemId', example='6487****621'),
          lmItemId?: string(name='LmItemId', example='10***642-6831****869'),
          lowGuideRetailPrice?: long(name='LowGuideRetailPrice'),
          priceCent?: long(name='PriceCent', example='7960'),
          reservedPrice?: long(name='ReservedPrice', example='8000'),
          skuId?: long(name='SkuId', example='488****548894'),
          skuTitle?: string(name='SkuTitle'),
          status?: int32(name='Status', example='1'),
        }
      ](name='SkuModels'),
    }
  ](name='Model'),
  requestId?: string(name='RequestId', example='E090F1A0-7454-5F36-933C-E6332CE2****'),
  subCode?: string(name='SubCode', example='200'),
  subMessage?: string(name='SubMessage', example='SUCCESS'),
  success?: boolean(name='Success', example='true'),
}

model QueryItemGuideRetailPriceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryItemGuideRetailPriceResponseBody(name='body'),
}

async function queryItemGuideRetailPriceWithOptions(tmpReq: QueryItemGuideRetailPriceRequest, runtime: Util.RuntimeOptions): QueryItemGuideRetailPriceResponse {
  Util.validateModel(tmpReq);
  var request = new QueryItemGuideRetailPriceShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.lmItemIds)) {
    request.lmItemIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.lmItemIds, 'LmItemIds', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.distributionMallId)) {
    body['DistributionMallId'] = request.distributionMallId;
  }
  if (!Util.isUnset(request.distributorId)) {
    body['DistributorId'] = request.distributorId;
  }
  if (!Util.isUnset(request.lmItemIdsShrink)) {
    body['LmItemIds'] = request.lmItemIdsShrink;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryItemGuideRetailPrice',
    version = '2022-05-31',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryItemGuideRetailPrice(request: QueryItemGuideRetailPriceRequest): QueryItemGuideRetailPriceResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryItemGuideRetailPriceWithOptions(request, runtime);
}

model QueryLogistics4DistributionRequest {
  distributorId?: string(name='DistributorId', example='1'),
  mainDistributionOrderId?: string(name='MainDistributionOrderId', example='123498124'),
  requestId?: string(name='RequestId'),
  tenantId?: string(name='TenantId'),
}

model QueryLogistics4DistributionResponseBody = {
  code?: string(name='Code', example='0000'),
  logsId?: string(name='LogsId', example='1'),
  message?: string(name='Message', example='SUCCESS'),
  model?: [ 
    {
      dataProvider?: string(name='DataProvider'),
      dataProviderTitle?: string(name='DataProviderTitle'),
      goods?: [ 
        {
          goodName?: string(name='GoodName'),
          itemId?: string(name='ItemId'),
          quantity?: int32(name='Quantity', example='1'),
          skuId?: string(name='SkuId'),
        }
      ](name='Goods'),
      logisticsCompanyCode?: string(name='LogisticsCompanyCode', example='SF'),
      logisticsCompanyName?: string(name='LogisticsCompanyName'),
      logisticsDetailList?: [ 
        {
          ocurrTimeStr?: string(name='OcurrTimeStr', example='2022-02-21 08:23:21'),
          standerdDesc?: string(name='StanderdDesc', example='""'),
        }
      ](name='LogisticsDetailList'),
      mailNo?: string(name='MailNo', example='SF124142********'),
    }
  ](name='Model'),
  pageNumber?: long(name='PageNumber', example='1'),
  pageSize?: long(name='PageSize', description='pageSize', example='20'),
  requestId?: string(name='RequestId', example='A7BE4356-7F92-533E-A31B-2EBF2D67****'),
  subCode?: string(name='SubCode', example='1004'),
  subMessage?: string(name='SubMessage', example='1004'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='5'),
}

model QueryLogistics4DistributionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryLogistics4DistributionResponseBody(name='body'),
}

async function queryLogistics4DistributionWithOptions(request: QueryLogistics4DistributionRequest, runtime: Util.RuntimeOptions): QueryLogistics4DistributionResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.distributorId)) {
    body['DistributorId'] = request.distributorId;
  }
  if (!Util.isUnset(request.mainDistributionOrderId)) {
    body['MainDistributionOrderId'] = request.mainDistributionOrderId;
  }
  if (!Util.isUnset(request.requestId)) {
    body['RequestId'] = request.requestId;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryLogistics4Distribution',
    version = '2022-05-31',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryLogistics4Distribution(request: QueryLogistics4DistributionRequest): QueryLogistics4DistributionResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryLogistics4DistributionWithOptions(request, runtime);
}

model QueryMallCategoryListRequest {
  categoryId?: long(name='CategoryId', example='5001****'),
  distributionMallId?: string(name='DistributionMallId', example='122889******114694'),
  distributorId?: string(name='DistributorId', example='75547******9212928'),
  tenantId?: string(name='TenantId', example='18******263'),
}

model QueryMallCategoryListResponseBody = {
  code?: string(name='Code', example='0000'),
  logsId?: string(name='LogsId', example='1'),
  message?: string(name='Message', example='SUCCESS'),
  model?: [ 
    {
      categoryId?: long(name='CategoryId', example='5001****'),
      leaf?: boolean(name='Leaf', example='true'),
      name?: string(name='Name'),
      parentId?: long(name='ParentId', example='1041577**'),
    }
  ](name='Model'),
  requestId?: string(name='RequestId', example='7152F15C-7298-5531-9A76-2ED2C331****'),
  subCode?: string(name='SubCode', example='SUCCESS'),
  subMessage?: string(name='SubMessage', example='SUCCESS'),
  success?: boolean(name='Success', example='true'),
}

model QueryMallCategoryListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryMallCategoryListResponseBody(name='body'),
}

async function queryMallCategoryListWithOptions(request: QueryMallCategoryListRequest, runtime: Util.RuntimeOptions): QueryMallCategoryListResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.categoryId)) {
    body['CategoryId'] = request.categoryId;
  }
  if (!Util.isUnset(request.distributionMallId)) {
    body['DistributionMallId'] = request.distributionMallId;
  }
  if (!Util.isUnset(request.distributorId)) {
    body['DistributorId'] = request.distributorId;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryMallCategoryList',
    version = '2022-05-31',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryMallCategoryList(request: QueryMallCategoryListRequest): QueryMallCategoryListResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryMallCategoryListWithOptions(request, runtime);
}

model QueryOrderDetail4DistributionRequest {
  distributorId?: string(name='DistributorId'),
  mainDistributionOrderId?: string(name='MainDistributionOrderId'),
  tenantId?: string(name='TenantId'),
}

model QueryOrderDetail4DistributionResponseBody = {
  code?: string(name='Code', example='SUCCESS'),
  logsId?: string(name='LogsId'),
  message?: string(name='Message', example='SUCCESS'),
  model?: {
    createDate?: string(name='CreateDate'),
    distributionOrderId?: string(name='DistributionOrderId'),
    distributorId?: string(name='DistributorId'),
    logisticsStatus?: string(name='LogisticsStatus'),
    orderAmount?: string(name='OrderAmount'),
    orderStatus?: string(name='OrderStatus', example='6'),
    subOrderList?: [ 
      {
        itemId?: string(name='ItemId'),
        itemPic?: string(name='ItemPic'),
        itemPrice?: [ 
          {
            fundAmountMoney?: string(name='FundAmountMoney'),
          }
        ](name='ItemPrice'),
        itemTitle?: string(name='ItemTitle'),
        logisticsStatus?: string(name='LogisticsStatus'),
        mainDistributionOrderId?: string(name='MainDistributionOrderId'),
        number?: string(name='Number', example='1'),
        orderStatus?: string(name='OrderStatus', example='6'),
        skuId?: string(name='SkuId', example='4771634532960'),
        skuName?: string(name='SkuName', example='500g'),
        subDistributionOrderId?: string(name='SubDistributionOrderId'),
      }
    ](name='SubOrderList'),
  }(name='Model'),
  pageNumber?: long(name='PageNumber', example='1'),
  pageSize?: long(name='PageSize', description='pageSize', example='20'),
  requestId?: string(name='RequestId', example='BA157565-3358-5D80-9330-************'),
  subCode?: string(name='SubCode', example='1004'),
  subMessage?: string(name='SubMessage', example='1004'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='10'),
}

model QueryOrderDetail4DistributionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryOrderDetail4DistributionResponseBody(name='body'),
}

async function queryOrderDetail4DistributionWithOptions(request: QueryOrderDetail4DistributionRequest, runtime: Util.RuntimeOptions): QueryOrderDetail4DistributionResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.distributorId)) {
    body['DistributorId'] = request.distributorId;
  }
  if (!Util.isUnset(request.mainDistributionOrderId)) {
    body['MainDistributionOrderId'] = request.mainDistributionOrderId;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryOrderDetail4Distribution',
    version = '2022-05-31',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryOrderDetail4Distribution(request: QueryOrderDetail4DistributionRequest): QueryOrderDetail4DistributionResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryOrderDetail4DistributionWithOptions(request, runtime);
}

model QueryOrderList4DistributionRequest {
  distributorId?: string(name='DistributorId'),
  filterOption?: string(name='FilterOption'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='20'),
  tenantId?: string(name='TenantId'),
}

model QueryOrderList4DistributionResponseBody = {
  code?: string(name='Code', example='0000'),
  logsId?: string(name='LogsId'),
  message?: string(name='Message', example='SUCCESS'),
  model?: [ 
    {
      createDate?: string(name='CreateDate'),
      distributionOrderId?: string(name='DistributionOrderId'),
      distributorId?: string(name='DistributorId'),
      logisticsStatus?: string(name='LogisticsStatus'),
      orderAmount?: string(name='OrderAmount'),
      orderStatus?: string(name='OrderStatus', example='6'),
      subOrderList?: [ 
        {
          itemId?: string(name='ItemId'),
          itemPic?: string(name='ItemPic'),
          itemPrice?: [ 
            {
              fundAmountMoney?: string(name='FundAmountMoney'),
            }
          ](name='ItemPrice'),
          itemTitle?: string(name='ItemTitle'),
          logisticsStatus?: string(name='LogisticsStatus'),
          mainDistributionOrderId?: string(name='MainDistributionOrderId'),
          number?: string(name='Number', example='1'),
          orderStatus?: string(name='OrderStatus', example='6'),
          skuId?: string(name='SkuId', example='4961467806350'),
          skuName?: string(name='SkuName', example='500g'),
          subDistributionOrderId?: string(name='SubDistributionOrderId'),
        }
      ](name='SubOrderList'),
    }
  ](name='Model'),
  pageNumber?: long(name='PageNumber', example='1'),
  pageSize?: long(name='PageSize', description='pageSize', example='20'),
  requestId?: string(name='RequestId', example='1267088B-4695-50DC-97B9-9E4F89D1****'),
  subCode?: string(name='SubCode', example='1004'),
  subMessage?: string(name='SubMessage', example='1004'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='16'),
}

model QueryOrderList4DistributionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryOrderList4DistributionResponseBody(name='body'),
}

async function queryOrderList4DistributionWithOptions(request: QueryOrderList4DistributionRequest, runtime: Util.RuntimeOptions): QueryOrderList4DistributionResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.distributorId)) {
    body['DistributorId'] = request.distributorId;
  }
  if (!Util.isUnset(request.filterOption)) {
    body['FilterOption'] = request.filterOption;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryOrderList4Distribution',
    version = '2022-05-31',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryOrderList4Distribution(request: QueryOrderList4DistributionRequest): QueryOrderList4DistributionResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryOrderList4DistributionWithOptions(request, runtime);
}

model QueryRefundApplicationDetail4DistributionRequest {
  distributorId?: string(name='DistributorId'),
  subDistributionOrderId?: string(name='SubDistributionOrderId'),
  tenantId?: string(name='TenantId'),
}

model QueryRefundApplicationDetail4DistributionResponseBody = {
  code?: string(name='Code', example='0000'),
  logsId?: string(name='LogsId', example='1'),
  message?: string(name='Message', example='SUCCESS'),
  model?: {
    applyDisputeDesc?: string(name='ApplyDisputeDesc'),
    applyReason?: {
      reasonTextId?: long(name='ReasonTextId'),
      reasonTips?: string(name='ReasonTips'),
    }(name='ApplyReason'),
    bizClaimType?: int32(name='BizClaimType', example='1'),
    disputeCreateTime?: string(name='DisputeCreateTime'),
    disputeDesc?: string(name='DisputeDesc'),
    disputeEndTime?: string(name='DisputeEndTime'),
    disputeId?: long(name='DisputeId', example='155816643598654055'),
    disputeStatus?: int32(name='DisputeStatus', example='1'),
    disputeType?: int32(name='DisputeType', example='0'),
    distributionOrderId?: string(name='DistributionOrderId', example='123498124'),
    orderLogisticsStatus?: int32(name='OrderLogisticsStatus', example='1'),
    realRefundFee?: long(name='RealRefundFee', example='2900'),
    refundFee?: long(name='RefundFee', example='2900'),
    refundFeeData?: {
      maxRefundFee?: long(name='MaxRefundFee'),
      minRefundFee?: long(name='MinRefundFee'),
    }(name='RefundFeeData'),
    refunderAddress?: string(name='RefunderAddress'),
    refunderName?: string(name='RefunderName'),
    refunderTel?: string(name='RefunderTel'),
    refunderZipCode?: string(name='RefunderZipCode'),
    returnGoodCount?: long(name='ReturnGoodCount', example='1'),
    returnGoodLogisticsStatus?: int32(name='ReturnGoodLogisticsStatus', example='1'),
    sellerAgreeMsg?: string(name='SellerAgreeMsg'),
    sellerRefuseAgreementMessage?: string(name='SellerRefuseAgreementMessage'),
    sellerRefuseReason?: string(name='SellerRefuseReason'),
    subDistributionOrderId?: string(name='SubDistributionOrderId', example='12131234'),
  }(name='Model'),
  pageNumber?: long(name='PageNumber', example='1'),
  pageSize?: long(name='PageSize', description='pageSize', example='20'),
  requestId?: string(name='RequestId', example='64ACF32E-5B78-5DDD-89D0-ACFA0B4BFF38'),
  subCode?: string(name='SubCode', example='1004'),
  subMessage?: string(name='SubMessage', example='SUCCESS'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='1'),
}

model QueryRefundApplicationDetail4DistributionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryRefundApplicationDetail4DistributionResponseBody(name='body'),
}

async function queryRefundApplicationDetail4DistributionWithOptions(request: QueryRefundApplicationDetail4DistributionRequest, runtime: Util.RuntimeOptions): QueryRefundApplicationDetail4DistributionResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.distributorId)) {
    body['DistributorId'] = request.distributorId;
  }
  if (!Util.isUnset(request.subDistributionOrderId)) {
    body['SubDistributionOrderId'] = request.subDistributionOrderId;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryRefundApplicationDetail4Distribution',
    version = '2022-05-31',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryRefundApplicationDetail4Distribution(request: QueryRefundApplicationDetail4DistributionRequest): QueryRefundApplicationDetail4DistributionResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryRefundApplicationDetail4DistributionWithOptions(request, runtime);
}

model RenderDistributionOrderRequest {
  buyerId?: string(name='BuyerId'),
  deliveryAddress?: string(name='DeliveryAddress'),
  distributionSupplierId?: string(name='DistributionSupplierId'),
  distributorId?: string(name='DistributorId'),
  extInfo?: string(name='ExtInfo'),
  itemInfoLists?: [ 
    {
      distributionMallId?: string(name='DistributionMallId'),
      lmItemId?: string(name='LmItemId'),
      quantity?: int32(name='Quantity'),
      skuId?: string(name='SkuId'),
    }
  ](name='ItemInfoLists'),
  tenantId?: string(name='TenantId'),
}

model RenderDistributionOrderShrinkRequest {
  buyerId?: string(name='BuyerId'),
  deliveryAddress?: string(name='DeliveryAddress'),
  distributionSupplierId?: string(name='DistributionSupplierId'),
  distributorId?: string(name='DistributorId'),
  extInfo?: string(name='ExtInfo'),
  itemInfoListsShrink?: string(name='ItemInfoLists'),
  tenantId?: string(name='TenantId'),
}

model RenderDistributionOrderResponseBody = {
  code?: string(name='Code'),
  logsId?: string(name='LogsId'),
  message?: string(name='Message'),
  model?: {
    addressInfos?: [ 
      {
        addressDetail?: string(name='AddressDetail'),
        addressId?: long(name='AddressId'),
        divisionCode?: string(name='DivisionCode'),
        isDefault?: boolean(name='IsDefault'),
        receiver?: string(name='Receiver'),
        receiverPhone?: string(name='ReceiverPhone'),
        townDivisionCode?: string(name='TownDivisionCode'),
      }
    ](name='AddressInfos'),
    canSell?: boolean(name='CanSell'),
    extInfo?: map[string]string(name='ExtInfo'),
    message?: string(name='Message'),
    renderOrderInfos?: [ 
      {
        canSell?: boolean(name='CanSell'),
        deliveryInfos?: [ 
          {
            displayName?: string(name='DisplayName'),
            id?: string(name='Id'),
            postFee?: long(name='PostFee'),
            serviceType?: long(name='ServiceType'),
          }
        ](name='DeliveryInfos'),
        extInfo?: map[string]string(name='ExtInfo'),
        invoiceInfo?: {
          desc?: string(name='Desc'),
          type?: string(name='Type'),
        }(name='InvoiceInfo'),
        itemInfos?: [ 
          {
            canSell?: boolean(name='CanSell'),
            distributionMallId?: string(name='DistributionMallId'),
            distributionSupplierId?: string(name='DistributionSupplierId'),
            distributorId?: string(name='DistributorId'),
            features?: map[string]string(name='Features'),
            itemId?: string(name='ItemId'),
            itemName?: string(name='ItemName'),
            itemPicUrl?: string(name='ItemPicUrl'),
            itemPromInstVOS?: [ 
              {
                availableItems?: [ 
                  {
                    itemId?: long(name='ItemId'),
                    lmItemId?: string(name='LmItemId'),
                    lmShopId?: long(name='LmShopId'),
                    number?: int32(name='Number'),
                    points?: long(name='Points'),
                    pointsAmount?: long(name='PointsAmount'),
                    priceCent?: long(name='PriceCent'),
                    removed?: boolean(name='Removed'),
                    skuId?: long(name='SkuId'),
                    tbSellerId?: long(name='TbSellerId'),
                    userPayFee?: long(name='UserPayFee'),
                  }
                ](name='AvailableItems'),
                canUse?: boolean(name='CanUse'),
                discountPrice?: long(name='DiscountPrice'),
                expireTime?: long(name='ExpireTime'),
                instanceId?: string(name='InstanceId'),
                level?: string(name='Level'),
                lmItemId?: string(name='LmItemId'),
                promotionName?: string(name='PromotionName'),
                promotionType?: string(name='PromotionType'),
                reason?: string(name='Reason'),
                selected?: boolean(name='Selected'),
                skuIds?: [ long ](name='SkuIds'),
                specialPrice?: long(name='SpecialPrice'),
                subBizCode?: string(name='SubBizCode'),
                tbSellerId?: long(name='TbSellerId'),
                thresholdPrice?: long(name='ThresholdPrice'),
                useStartTime?: long(name='UseStartTime'),
              }
            ](name='ItemPromInstVOS'),
            itemUrl?: string(name='ItemUrl'),
            message?: string(name='Message'),
            price?: long(name='Price'),
            promotionFee?: long(name='PromotionFee'),
            quantity?: int32(name='Quantity'),
            reservePrice?: long(name='ReservePrice'),
            skuId?: long(name='SkuId'),
            skuName?: string(name='SkuName'),
            virtualItemType?: string(name='VirtualItemType'),
          }
        ](name='ItemInfos'),
        message?: string(name='Message'),
        shopPromInstVOS?: [ 
          {
            availableItems?: [ 
              {
                itemId?: long(name='ItemId'),
                lmItemId?: string(name='LmItemId'),
                lmShopId?: long(name='LmShopId'),
                number?: int32(name='Number'),
                points?: long(name='Points'),
                pointsAmount?: long(name='PointsAmount'),
                priceCent?: long(name='PriceCent'),
                removed?: boolean(name='Removed'),
                skuId?: long(name='SkuId'),
                tbSellerId?: long(name='TbSellerId'),
                userPayFee?: long(name='UserPayFee'),
              }
            ](name='AvailableItems'),
            canUse?: boolean(name='CanUse'),
            discountPrice?: long(name='DiscountPrice'),
            expireTime?: long(name='ExpireTime'),
            instanceId?: string(name='InstanceId'),
            level?: string(name='Level'),
            lmItemId?: string(name='LmItemId'),
            promotionName?: string(name='PromotionName'),
            promotionType?: string(name='PromotionType'),
            reason?: string(name='Reason'),
            selected?: boolean(name='Selected'),
            skuIds?: [ long ](name='SkuIds'),
            specialPrice?: long(name='SpecialPrice'),
            subBizCode?: string(name='SubBizCode'),
            tbSellerId?: long(name='TbSellerId'),
            thresholdPrice?: long(name='ThresholdPrice'),
            useStartTime?: long(name='UseStartTime'),
          }
        ](name='ShopPromInstVOS'),
      }
    ](name='RenderOrderInfos'),
    unsellableRenderOrderInfos?: [ 
      {
        canSell?: boolean(name='CanSell'),
        deliveryInfos?: [ 
          {
            displayName?: string(name='DisplayName'),
            id?: string(name='Id'),
            postFee?: long(name='PostFee'),
            serviceType?: long(name='ServiceType'),
          }
        ](name='DeliveryInfos'),
        extInfo?: map[string]string(name='ExtInfo'),
        invoiceInfo?: {
          desc?: string(name='Desc'),
          type?: string(name='Type'),
        }(name='InvoiceInfo'),
        itemInfos?: [ 
          {
            canSell?: boolean(name='CanSell'),
            distributionMallId?: string(name='DistributionMallId'),
            distributionSupplierId?: string(name='DistributionSupplierId'),
            distributorId?: string(name='DistributorId'),
            features?: map[string]string(name='Features'),
            itemId?: string(name='ItemId'),
            itemName?: string(name='ItemName'),
            itemPicUrl?: string(name='ItemPicUrl'),
            itemPromInstVOS?: [ 
              {
                availableItems?: [ 
                  {
                    itemId?: long(name='ItemId'),
                    lmItemId?: string(name='LmItemId'),
                    lmShopId?: long(name='LmShopId'),
                    number?: int32(name='Number'),
                    points?: long(name='Points'),
                    pointsAmount?: long(name='PointsAmount'),
                    priceCent?: long(name='PriceCent'),
                    removed?: boolean(name='Removed'),
                    skuId?: long(name='SkuId'),
                    tbSellerId?: long(name='TbSellerId'),
                    userPayFee?: long(name='UserPayFee'),
                  }
                ](name='AvailableItems'),
                canUse?: boolean(name='CanUse'),
                discountPrice?: long(name='DiscountPrice'),
                expireTime?: long(name='ExpireTime'),
                instanceId?: string(name='InstanceId'),
                level?: string(name='Level'),
                lmItemId?: string(name='LmItemId'),
                promotionName?: string(name='PromotionName'),
                promotionType?: string(name='PromotionType'),
                reason?: string(name='Reason'),
                selected?: boolean(name='Selected'),
                skuIds?: [ long ](name='SkuIds'),
                specialPrice?: long(name='SpecialPrice'),
                subBizCode?: string(name='SubBizCode'),
                tbSellerId?: long(name='TbSellerId'),
                thresholdPrice?: long(name='ThresholdPrice'),
                useStartTime?: long(name='UseStartTime'),
              }
            ](name='ItemPromInstVOS'),
            itemUrl?: string(name='ItemUrl'),
            message?: string(name='Message'),
            price?: long(name='Price'),
            promotionFee?: long(name='PromotionFee'),
            quantity?: int32(name='Quantity'),
            reservePrice?: long(name='ReservePrice'),
            skuId?: long(name='SkuId'),
            skuName?: string(name='SkuName'),
            virtualItemType?: string(name='VirtualItemType'),
          }
        ](name='ItemInfos'),
        message?: string(name='Message'),
        shopPromInstVOS?: [ 
          {
            availableItems?: [ 
              {
                itemId?: long(name='ItemId'),
                lmItemId?: string(name='LmItemId'),
                lmShopId?: long(name='LmShopId'),
                number?: int32(name='Number'),
                points?: long(name='Points'),
                pointsAmount?: long(name='PointsAmount'),
                priceCent?: long(name='PriceCent'),
                removed?: boolean(name='Removed'),
                skuId?: long(name='SkuId'),
                tbSellerId?: long(name='TbSellerId'),
                userPayFee?: long(name='UserPayFee'),
              }
            ](name='AvailableItems'),
            canUse?: boolean(name='CanUse'),
            discountPrice?: long(name='DiscountPrice'),
            expireTime?: long(name='ExpireTime'),
            instanceId?: string(name='InstanceId'),
            level?: string(name='Level'),
            lmItemId?: string(name='LmItemId'),
            promotionName?: string(name='PromotionName'),
            promotionType?: string(name='PromotionType'),
            reason?: string(name='Reason'),
            selected?: boolean(name='Selected'),
            skuIds?: [ long ](name='SkuIds'),
            specialPrice?: long(name='SpecialPrice'),
            subBizCode?: string(name='SubBizCode'),
            tbSellerId?: long(name='TbSellerId'),
            thresholdPrice?: long(name='ThresholdPrice'),
            useStartTime?: long(name='UseStartTime'),
          }
        ](name='ShopPromInstVOS'),
      }
    ](name='UnsellableRenderOrderInfos'),
  }(name='Model'),
  pageNumber?: long(name='PageNumber'),
  pageSize?: long(name='PageSize', description='pageSize'),
  requestId?: string(name='RequestId'),
  subCode?: string(name='SubCode'),
  subMessage?: string(name='SubMessage'),
  success?: boolean(name='Success'),
  totalCount?: long(name='TotalCount'),
}

model RenderDistributionOrderResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RenderDistributionOrderResponseBody(name='body'),
}

async function renderDistributionOrderWithOptions(tmpReq: RenderDistributionOrderRequest, runtime: Util.RuntimeOptions): RenderDistributionOrderResponse {
  Util.validateModel(tmpReq);
  var request = new RenderDistributionOrderShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.itemInfoLists)) {
    request.itemInfoListsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.itemInfoLists, 'ItemInfoLists', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.buyerId)) {
    body['BuyerId'] = request.buyerId;
  }
  if (!Util.isUnset(request.deliveryAddress)) {
    body['DeliveryAddress'] = request.deliveryAddress;
  }
  if (!Util.isUnset(request.distributionSupplierId)) {
    body['DistributionSupplierId'] = request.distributionSupplierId;
  }
  if (!Util.isUnset(request.distributorId)) {
    body['DistributorId'] = request.distributorId;
  }
  if (!Util.isUnset(request.extInfo)) {
    body['ExtInfo'] = request.extInfo;
  }
  if (!Util.isUnset(request.itemInfoListsShrink)) {
    body['ItemInfoLists'] = request.itemInfoListsShrink;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'RenderDistributionOrder',
    version = '2022-05-31',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function renderDistributionOrder(request: RenderDistributionOrderRequest): RenderDistributionOrderResponse {
  var runtime = new Util.RuntimeOptions{};
  return renderDistributionOrderWithOptions(request, runtime);
}

model SubmitReturnGoodLogistics4DistributionRequest {
  cpCode?: string(name='CpCode', example='SF'),
  disputeId?: long(name='DisputeId', example='14244******33071'),
  distributorId?: string(name='DistributorId'),
  logisticsNo?: string(name='LogisticsNo', example='SF131*****7061'),
  subDistributionOrderId?: string(name='SubDistributionOrderId'),
  tenantId?: string(name='TenantId'),
}

model SubmitReturnGoodLogistics4DistributionResponseBody = {
  code?: string(name='Code', example='0000'),
  logsId?: string(name='LogsId', example='1'),
  message?: string(name='Message', example='SUCCESS'),
  pageNumber?: long(name='PageNumber', example='1'),
  pageSize?: long(name='PageSize', description='pageSize', example='20'),
  requestId?: string(name='RequestId', example='79C01D47-3C44-57D9-BC99-1B33F7ED****'),
  subCode?: string(name='SubCode', example='1004'),
  subMessage?: string(name='SubMessage', example='SUCCESS'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='16'),
}

model SubmitReturnGoodLogistics4DistributionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SubmitReturnGoodLogistics4DistributionResponseBody(name='body'),
}

async function submitReturnGoodLogistics4DistributionWithOptions(request: SubmitReturnGoodLogistics4DistributionRequest, runtime: Util.RuntimeOptions): SubmitReturnGoodLogistics4DistributionResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.cpCode)) {
    body['CpCode'] = request.cpCode;
  }
  if (!Util.isUnset(request.disputeId)) {
    body['DisputeId'] = request.disputeId;
  }
  if (!Util.isUnset(request.distributorId)) {
    body['DistributorId'] = request.distributorId;
  }
  if (!Util.isUnset(request.logisticsNo)) {
    body['LogisticsNo'] = request.logisticsNo;
  }
  if (!Util.isUnset(request.subDistributionOrderId)) {
    body['SubDistributionOrderId'] = request.subDistributionOrderId;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SubmitReturnGoodLogistics4Distribution',
    version = '2022-05-31',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function submitReturnGoodLogistics4Distribution(request: SubmitReturnGoodLogistics4DistributionRequest): SubmitReturnGoodLogistics4DistributionResponse {
  var runtime = new Util.RuntimeOptions{};
  return submitReturnGoodLogistics4DistributionWithOptions(request, runtime);
}

